package com.ruoyi.roadcard.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.roadcard.mapper.RoadCardMapper;
import com.ruoyi.roadcard.domain.RoadCard;
import com.ruoyi.roadcard.service.IRoadCardService;

/**
 * 行程码查询Service业务层处理
 *
 * @author 刘焕然
 * @date 2022-12-09
 */
@Service
public class RoadCardServiceImpl implements IRoadCardService
{
    @Autowired
    private RoadCardMapper roadCardMapper;

    /**
     * 查询行程码查询
     *
     * @param id 行程码查询主键
     * @return 行程码查询
     */
    @Override
    public RoadCard selectRoadCardById(Long id)
    {
        return roadCardMapper.selectRoadCardById(id);
    }

    /**
     * 查询行程码查询列表
     *
     * @param roadCard 行程码查询
     * @return 行程码查询
     */
    @Override
    public List<RoadCard> selectRoadCardList(RoadCard roadCard)
    {
        return roadCardMapper.selectRoadCardList(roadCard);
    }

    /**
     * 新增行程码查询
     *
     * @param roadCard 行程码查询
     * @return 结果
     */
    @Override
    public int insertRoadCard(RoadCard roadCard)
    {
        roadCard.setCreateTime(DateUtils.getNowDate());
        return roadCardMapper.insertRoadCard(roadCard);
    }

    /**
     * 修改行程码查询
     *
     * @param roadCard 行程码查询
     * @return 结果
     */
    @Override
    public int updateRoadCard(RoadCard roadCard)
    {
        roadCard.setUpdateTime(DateUtils.getNowDate());
        return roadCardMapper.updateRoadCard(roadCard);
    }

    /**
     * 批量删除行程码查询
     *
     * @param ids 需要删除的行程码查询主键
     * @return 结果
     */
    @Override
    public int deleteRoadCardByIds(Long[] ids)
    {
        return roadCardMapper.deleteRoadCardByIds(ids);
    }

    /**
     * 删除行程码查询信息
     *
     * @param id 行程码查询主键
     * @return 结果
     */
    @Override
    public int deleteRoadCardById(Long id)
    {
        return roadCardMapper.deleteRoadCardById(id);
    }

    @Override
    public int deleteRoadCardByIdCards(String[] idCards) {
        return roadCardMapper.deleteRoadCardByIdCards(idCards);
    }
}
